//引入mock
let Mock = require('mockjs')

let Random = Mock.Random
//随机生成email
console.log(Random.email())
console.log(Mock.mock('@email'))  //不区分大小写@EMAIL也可以
console.log(Mock.mock({
    email:'@email'
}))

/**
 * Mock.Random 提供的完整方法（占位符）如下：
 * Basic	        boolean, natural, integer, float, character, string, range, date, time, datetime, now
 * Image	        image, dataImage
 * Color	        color
 * Text	            paragraph, sentence, word, title, cparagraph, csentence, cword, ctitle
 * Name	            first, last, name, cfirst, clast, cname
 * Web	            url, domain, email, ip, tld
 * Address	        
 * region:随机生成一个大区
 * province:随机生成一个（中国）省（或直辖市、自治区、特别行政区）
 * city:随机生成一个（中国）市,county:随机生成一个（中国）县
 * zip:随机生成一个邮政编码（六位数字）
 * Helper	        capitalize, upper, lower, pick, shuffle
 * Miscellaneous	guid, id(生成18位身份证)
 */
console.log(Random.id())

//扩展随机方法
Random.extend({
    constellation:function(date){
        let constellations = ['白羊座', '金牛座', '双子座', '巨蟹座', '狮子座', '处女座', '天秤座', '天蝎座', '射手座', '摩羯座', '水瓶座', '双鱼座']
        return this.pick(constellations)
    }
})
console.log(Random.constellation())
console.log(Mock.mock('@constellation'))
